package com.leonardo.persistenceme.metadatahandlers.taghandlers;

import org.xml.sax.Attributes;

import com.leonardo.beanme.exceptions.XmlReadingException;

public class PersistencemeTagHandler extends TagHandler {

	private boolean documentOpened = false;
	private boolean alreadyOpenedOnce = false;
	
	public String getTagName() {
		return "persistenceme";
	}
	
	public void startTag(Attributes attributes){
		if(documentOpened || alreadyOpenedOnce)
			throw new XmlReadingException("Incorrect place of tag persistenceme");
		documentOpened = true;
		alreadyOpenedOnce = true;
	}
	
	public void endTag() {
		documentOpened = false;
	}
	
}
